Hop Client-Side Compilation
نویسندگان
چکیده
Hop is a new language for programming interactive Web applications. It aims to replace HTML, JavaScript, and server-side scripting languages (such as PHP, JSP) with a unique language that is used for client-side interactions and server-side computations. A Hop execution platform is made of two compilers: one that compiles the code executed by the server, and one that compiles the code executed by the client. This paper presents the latter. In order to ensure compatibility of Hop graphical user interfaces with popular plain Web browsers, the client-side Hop compiler has to generate regular HTML and JavaScript code. The generated code runs roughly at the same speed as hand-written code. Since the Hop language is built on top of the Scheme programming language, compiling Hop to JavaScript is nearly equivalent to compiling Scheme to JavaScript. The compiler we have designed supports the whole Scheme core language. In particular, it features proper tail recursion. However complete tail recursion optimization may slow down the generated code and is hence disabled in Hop. Most of our benchmarks were unaffected by the transformation but in the worst case programs were more than two times slower with it enabled. The techniques presented in this paper can be applied to most strict functional languages such as ML and Lisp.
منابع مشابه
HopTeX - Compiling HTML to LaTeX with CSS
This article presents HopTeX, a new application for authoring HTML and LTEX documents. The content of the document is either be expressed in HTML or in a blending of HTML and a dedicated wiki syntax, for the sake of conciseness and readability. The rendering of the document is expressed by a set of CSS rules. The main originality of HOPTEX is to consider LTEX as a new media type for HTML and to...
متن کاملReasoning for Web Applications: An Operational Semantics for Hop
We propose a small-step operational semantics to support reasoning about web applications written in the multi-tier language Hop. The semantics covers both server side and client side computations, as well as their interactions, and includes creation of web services, distributed client-server communications, concurrent evaluation of service requests at server side, elaboration of HTML documents...
متن کاملA Multitier Debugger for Web Applications
Debugging Web applications is difficult because of their distributed nature but also because of the programming languages and tools commonly used to develop them. Taking benefit of the multitier aspect of the Hop programming language, we have built a new debugger for Web applications that copes with the server-side and the client-side of the executions. Its advantage over most debuggers for the...
متن کاملAutomated Code Injection Prevention for Web Applications
We propose a new technique based on multitier compilation for preventing code injection in web applications. It consists in adding an extra stage to the client code generator which compares the dynamically generated code with the specification obtained from the syntax of the source program. No intervention from the programmer is needed. No plugin or modification of the web browser is required. ...
متن کاملTierless Web programming in the large
Tierless Web programming languages allows combining client-side and server-side programming in a single program. This allows defining expressions with both client and server parts, and at the same time provides good static guarantees regarding client-server communication. However, these nice properties come at a cost: most tierless languages offer very poor support for modularity and separate c...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007